package com.qf.ems.service.Impl;


import com.qf.ems.entity.User;
import com.qf.ems.mapper.UserMapper;
import com.qf.ems.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;

@Service
/*2021/9/11*/public class UserServiceImpl implements UserService {

    @Autowired
    UserMapper userMapper;
     //调用dao的查询单条数据功能，并进行对比，与传入的数据是否相同，并返回相应的值

    public User selectOneInfo(String username, String password) {
        User user=null;
        //调用dao的select方法
        user = userMapper.select(username);
        if(user!=null){
            if(user.getPassword().equals(password)){
                return user;
            }
        }

        return null;



    }
}
